One of the image information encoding methods is the BTC (Block Truncation Coding) wherein an image to be encoded is divided into a plurality of blocks and is encoded for each block. Generally, in the BTC method, image information is divided into rectangular blocks each consisting of “n” by “m” pixels (e.g., 4 by 4 pixels), and each block is encoded in such a way as to be expressed by one or a plurality of representative values representing the gradation values of the pixel pertaining to the block, and the label information to indicate the compatibility between each pixel pertaining to the block and the representative value. The BTC is an encoding method with attention being given to the fact that the distribution range of gradation value is comparatively small within one block even for the original image wherein the distribution range of gradation to be occupied by each pixel is 256 gradations, for example.
FIG. 11 shows an example of encoding image data by BTC. FIG. 12 shows an example of decoding the encoded image data. In this example, original image data 80 for one block of four by four pixels wherein each pixel is represented in 8 bits (256 gradations) is encoded in label information of 2 bits (4 gradations) per pixel.
In FIG. 11, maximum value 178 and minimum value 4 of the gradation values within block 80 are detected at the time of encoding, and the range of distribution wherein these values constitute both ends is divided into four equal parts. The pixel wherein gradation value D is represented by the maximum value 178≧D>135, is encoded into 2-bit label information “11”, the pixel of 135≧D>91 is encoded into label information “10”, the pixel of 91≧D>48 is encoded into label information “01”, and the pixel of 48≧D≧the minimum value 4 is encoded into label information “00”. Encoded image data 81 of the block 80 includes the label information (32 bit) for these 16 pixels, and four representative values corresponding to the label information or the information capable of calculating these four representative values, e.g., the difference between the maximum value and minimum value (the difference between maximum and minimum) and intermediate value, or the maximum value 178 and minimum value 4. FIGS. 11 and 12 show examples of using the difference between maximum and minimum and an intermediate value.
As shown in FIG. 12, at the time of decoding, each piece of label information is converted to the pixel wherein the representative value corresponding to the label information is the decoded value (gradation value). In the example of FIG. 12, four representative values are calculated from the difference between maximum and minimum and the intermediate value in the first place. In this case, the first representative value corresponding to the label information “00” is calculated as {the intermediate value−(the difference between maximum and minimum/2)}; the second representative value corresponding to the label information “01” is calculated as {the first representative value+(the difference between maximum and minimum/3)}; the third representative value corresponding to the label information “10” is calculated as {the first representative value+2×(the difference between maximum and minimum/3)}; and the fourth representative value corresponding to the label information “11” is calculated as {the first representative value+(the difference between maximum and minimum)}. Each piece of label information is converted into the corresponding representative value, and hence into decoded image data 82 for one block.
When the aforementioned method is used for encoding and decoding, grid-like noise known as “block noise” occurs when continuity of image data between adjacent blocks is deteriorated. In the aforementioned BTC, for example, in a block including the outline (edge portion) of text and ground color portion, there will be an increase in the range of distribution of the gradation value of the pixel inside the block (the difference between maximum and minimum: dynamic range). This will increase the gradation range expressed by one representative value having a limited number of gradations, and subtle difference in gradation will not be reproduced. In the meantime, in a block (e.g., a block of ground color alone) with smaller dynamic range free of an edge or the like, a subtle difference in gradation is reproduced even with representative values having a limited number of gradations. Thus, if there is a conspicuous difference in the dynamic range between adjacent blocks, a subtle difference in gradation reproduced in the blocks having a narrower dynamic range will be lost in the blocks with a wider dynamic range. Due to this discontinuity of gradation between adjacent blocks, more perceivable block noise is produced in the conventional method.
For example, FIG. 13 shows a case when the first block (dynamic range: 60) as the portion of ground color and the second block (dynamic range: 174) including the ground color and edge are adjacent to each other, and shows encoded image data 51A of the first block and 52A of the second block and decoded image data 51B and 52B obtained by decoding the same. In the encoded image data 52A, the portion wherein the label information is “11” represents the ground color portion following the adjacent first block. In the decoded image data 51B of the first block, the subtle difference in gradation of the ground color is reproduced. In the decoded image data 52B of the adjacent second block, the portion of ground color is encoded uniformly to the same gradation value (178) and the difference in gradation is lost. Thus, the boundary between blocks is conspicuous and block noise is produced.
An example of a device capable of removing the block distortion occurring at the time of decoding includes an image signal decoding apparatus wherein a low-path filter is applied to the pixels closer to the block boundary inside the decoded image (e.g., Unexamined Japanese Patent Application Publication No. 2005-160117). In this device, the passband characteristic, of the low-path filter applied to the pixels closer to the block boundary, is changed in response to the dynamic range of the detected block, and the block distortion produced at the time of decoding is removed without deteriorating the edge and details.
In the device disclosed in the aforementioned Unexamined Japanese Patent Application Publication No. 2005-160117, a low-path filter is applied to the pixel close to the block boundary, therefore, this method has the disadvantage of the subtle difference in gradation being lost.
In view of the problems described above, it is an object of the present invention to provide an image decoding apparatus and an image decoding method capable of reducing block noise without the subtle difference in gradation being lost.